﻿using StackExchange.Profiling;
using StackExchange.Profiling.EntityFramework6;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace EF_Brave.Web
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_BeginRequest()
        {
            MiniProfiler.Start();
        }

        protected void Application_Start()
        {
            //log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("log4net.config"));//注册Log4net(在Log4NetLoggerFactoryAdapter.cs里配置了,所以这里注册掉)
            var container = BuildContainerRegister.BuildContainer();//注册autofac容器
            MiniProfilerEF6.Initialize();//初始化Miniprofiler





            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

        }

        protected void Application_EndRequest()
        {
            MiniProfiler.Stop();
        }
    }
}
